import React from 'react';
import { DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;

function onChange(dates, dateStrings) {
  console.log('From: ', dates[0], ', to: ', dates[1]);
  console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
}


const presetCommonDateRanges  = props =>{
  return   <>
  <RangePicker
    ranges={{
      Today: [moment(), moment()],
      'This Month': [moment().startOf('month'), moment().endOf('month')],
    }}
    onChange={onChange}
    style={{marginBottom:10}}
  />
  <br />
  <RangePicker
    ranges={{
      Today: [moment(), moment().endOf('day')],
      'This Month': [moment().startOf('month'), moment().endOf('month')],
    }}
    showTime
    format="YYYY/MM/DD HH:mm:ss"
    onChange={onChange}
  />
</>
}

export default presetCommonDateRanges ;